//
//  JMExtension.swift
//  SuperZip
//
//  Created by JM Zhao on 2018/2/26.
//  Copyright © 2018年 赵俊明. All rights reserved.
//

import UIKit
import Foundation

public extension UIView {
    
    func size() -> CGSize {
        
        return self.frame.size
    }
    
    func height() -> CGFloat {
        
        return self.frame.size.height
    }
    
    func width() -> CGFloat {
        
        return self.frame.size.width
    }
    
    func origin() -> CGPoint {
        
        return self.frame.origin
    }
    
    func x() -> CGFloat {
        
        return self.frame.origin.x
    }
    
    func y() -> CGFloat {
        
        return self.frame.origin.y
    }
    
    func centerX() -> CGFloat {
        
        return self.center.x
    }
    
    func centerY() -> CGFloat {
        
        return self.center.y
    }
    
    func bottom() -> CGFloat {
        
        return self.frame.origin.y + self.frame.size.height;
    }
    
    func rightMargin() -> CGFloat {
        
        return self.frame.origin.x + self.frame.size.width;
    }
}

public extension NSString {
    
//    func sizeWithFont(font:UIFont, maxW:CGFloat) -> CGSize {
//
//        let attrs = NSMutableDictionary()
//        attrs[NSAttributedStringKey.font] = font
//        let maxSize = CGSizeMake(maxW, 100)
//        return self
//
//
//    }
//
//    func sizeWithFont(font:UIFont) -> CGSize {
//
//    }
    
    
}











































